package com.lemon.jvm.hotspot.src.share.vm.oops;

import com.lemon.jvm.hotspot.src.share.vm.intepreter.BytecodeStream;

import java.util.HashMap;
import java.util.Map;

public class CodeAttributeInfo {

    private int attrNameIndex;
    private int attrLength;

    private int maxStack;
    private int maxLocals;

    private int codeLength;
    private BytecodeStream code;

    private int exceptionTableLength;

    // 如局部变量表、操作数栈
    private int attributesCount;

    private Map<String, AttributeInfo> attributes = new HashMap<>();

    public int getAttrNameIndex() {
        return attrNameIndex;
    }

    public void setAttrNameIndex(int attrNameIndex) {
        this.attrNameIndex = attrNameIndex;
    }

    public int getAttrLength() {
        return attrLength;
    }

    public void setAttrLength(int attrLength) {
        this.attrLength = attrLength;
    }

    public int getMaxStack() {
        return maxStack;
    }

    public void setMaxStack(int maxStack) {
        this.maxStack = maxStack;
    }

    public int getMaxLocals() {
        return maxLocals;
    }

    public void setMaxLocals(int maxLocals) {
        this.maxLocals = maxLocals;
    }

    public int getCodeLength() {
        return codeLength;
    }

    public void setCodeLength(int codeLength) {
        this.codeLength = codeLength;
    }

    public BytecodeStream getCode() {
        return code;
    }

    public void setCode(BytecodeStream code) {
        this.code = code;
    }

    public int getExceptionTableLength() {
        return exceptionTableLength;
    }

    public void setExceptionTableLength(int exceptionTableLength) {
        this.exceptionTableLength = exceptionTableLength;
    }

    public int getAttributesCount() {
        return attributesCount;
    }

    public void setAttributesCount(int attributesCount) {
        this.attributesCount = attributesCount;
    }

    public Map<String, AttributeInfo> getAttributes() {
        return attributes;
    }

    public void setAttributes(Map<String, AttributeInfo> attributes) {
        this.attributes = attributes;
    }
}
